package com.texas_android.app.Appconfig;

import android.app.Application;

import com.iflytek.cloud.SpeechConstant;
import com.iflytek.cloud.SpeechUtility;
import com.texas_android.app.http.ApiHttpClient;
import com.texas_android.app.utils.cathe.ACache;

/**
 * Created by solin on 2018/3/13.
 */

public class MyApplication extends Application {
    public static boolean isFirstOpen = true;
    public static ACache aCache;

    @Override
    public void onCreate() {
        super.onCreate();
        init();
    }

    /**
     * 初始化相关内容
     */
    private void init() {
        ApiHttpClient.init(this);
        getAcache();
        // 将“12345678”替换成您申请的 APPID，申请地址： http://www.xfyun.cn
        // 请勿在 “ =”与 appid 之间添加任务空字符或者转义符
        SpeechUtility.createUtility(this, SpeechConstant.APPID + "=5aaa3d1d");
    }

    /**
     * 初始化  Acache
     *
     * @return
     */
    public synchronized ACache getAcache() {
        if (aCache == null)
            aCache = ACache.get(this);
        return aCache;
    }
}
